package calorie.com.calorie.util;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.ido.ble.BLEManager;

import java.util.ArrayList;
import java.util.List;

import calorie.com.calorie.R;
import calorie.com.calorie.response.UserAssets;


public class BLEUpdateBroadcastReceiver extends BroadcastReceiver {
    public static final String TAG = "BLEUpdateBroadcastReceiver";
    public static TextView bracelet_view;


    public static List<TextView> cal_num_view = new ArrayList<>();
    public static List<TextView> vit_num_view = new ArrayList<>();

    public BLEUpdateBroadcastReceiver(TextView bracelet_view) {
        this.bracelet_view = bracelet_view;
    }

    @Override
    public void onReceive(Context context, Intent intent) { //接收广播
        if (intent.getStringExtra("userAssets") != null) {
        }

    }

    public static void setAssets(UserAssets assets) {
        if (assets != null) {
            for (TextView vit : vit_num_view) {
                vit.setText(assets.getTivNum());
            }

            for (TextView cal : cal_num_view) {
                cal.setText(assets.getCalNum());
            }

        }
    }

}
